package com.sg.dto.biz.operation.common;

import com.sg.common.dto.BaseDto;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.Objects;

/**
 * @desc RouterDto
 * @使用场景
 */
@Data
public class RouterDto extends BaseDto implements Serializable {

    /**
     * 路由地址
     */
    @NotNull(message = "路由地址不能为空")
    @ApiModelProperty("路由地址")
    private String routerAdress;

    /**
     * Bff路由IP
     */
    @NotNull(message = "Bff路由IP不能为空")
    @ApiModelProperty("Bff路由IP")
    private String bffRouterIP;

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        if (!super.equals(o)) return false;
        RouterDto that = (RouterDto) o;
        return routerAdress == that.routerAdress && bffRouterIP == that.bffRouterIP;
    }

    @Override
    public int hashCode() {
        return Objects.hash(super.hashCode(), routerAdress, bffRouterIP);
    }

}
